addonName, VRA = ...
local _G = _G
local f = _G['VOnUpdateForm']
if f == nil then f = CreateFrame('frame', 'VOnUpdateForm', UIParent) end
f:SetScript('OnUpdate', function(self, elapsed)
	local throttle = 1 / GetFramerate()
	self.st = elapsed + (self.st or 0)
	if self.st > throttle then
		if not PQI_General_GUI_Loaded then
			local AddonVersion = GetAddOnMetadata("VRA", "Version")
			print("\124cFFFF55FFVRA v"..AddonVersion.." Loaded.")
			local config = {
				name	= 'General',
				author	= 'Vachiusa',
				abilities = {
					-- General --
					{	name = "Disable Rotation",
						tooltip = "Disable Rotation.",
						enable = false,
					},
					{ 	name = "Rotation Engine",	
						enable = true,
						tooltip = "Choose your Rotation Engine",
						widget = { type = 'select',
							values = Vasa_EngineValues,
							value = 4,
							tooltip = "Select one!",
							width = 100,
						},
					},
					{ 	name = "Join Queue",
						enable = false,
						tooltip = "Enables the use of Join Queue",
					},
					{ 	name = "Ready Check",
						enable = false,
						tooltip = "Enables the use of Ready Check",
					},
					{ 	name = "Role Poll",
						enable = false,
						tooltip = "Enables the use of Role Poll",
					},
					{ 	name = "Role Queue",
						enable = false,
						tooltip = "Enables the use of Role Queue",
					},								
					{ 	name = "Resurect",
						enable = false,
						tooltip = "Enables the use of Resurect",
					},	
					{ 	name = "Summon",
						enable = false,
						tooltip = "Enables the use of Summon",
					},										
					{ 	name = "Follow Tanks",	
						enable = false,
						tooltip = "Enables the use of Follow Tanks",
						widget = { type = 'numBox',
							value = 10,
							step = 1,
							max = 40,
							min = 0,
							tooltip = "The distance between you and tank to follow at",
						},
					},	
					{ 	name = "Delay Accept Time",	
						enable = true,
						tooltip = "not work",
						widget = { type = 'numBox',
							value = 5,
							step = 1,
							max = 20,
							min = 0,
							tooltip = "The delay time before accept pop at",
						},
					},	
				},
				hotkeys = {
				},
			}
			PQI_General_GUI_Loaded = PQI:AddRotation(config)
		end

		if not PQI_VachiusaGeneral_DisableRotation_enable then
			VachiusaUtility()

			local VRS = GetSpecializationInfo(GetSpecialization())
			if VRS == 66 then
				VPAProtection()
			elseif VRS == 65 then
				VPAHoly()
			elseif VRS == 270 then
				VMOMist()
			elseif VRS == 268 then
				VMOBrew()
			elseif VRS == 105 then
				VDRResto()
			elseif VRS == 104 then
				VDRGuard()
			elseif VRS == 256 then
				VPRDisc()
			elseif VRS == 257 then
				VPRHoly()
			elseif VRS == 264 then
				VSHResto()			
			end				
		end
		self.st = 0
	end
end)